<!-- Port partial HTML -->
<div id="ov-port">
    <div class="tabular-header">
        <h2>
            Ports for Device {{devId || "(No device selected)"}}
            ({{tableData.length}} Ports total)
        </h2>

        <div class="ctrl-btns">
            <div class="refresh" ng-class="{active: autoRefresh}"
                 icon icon-size="42" icon-id="refresh"
                 tooltip tt-msg="autoRefreshTip"
                 ng-click="toggleRefresh()"></div>

            <div class="separator"></div>

            <div class="refresh" ng-class="{active: isNZ()}"
                 icon icon-size="42" icon-id="nonzero"
                 tooltip tt-msg="toggleNZTip"
                 ng-click="toggleNZ()"></div>

            <div class="refresh" ng-class="{active: isDelta()}"
                 icon icon-size="42" icon-id="delta"
                 tooltip tt-msg="toggleDeltaTip"
                 ng-click="toggleDelta()"></div>

            <div class="separator"></div>

            <div class="active"
                 icon icon-id="deviceTable" icon-size="42"
                 tooltip tt-msg="deviceTip"
                 ng-click="nav('device')"></div>

            <div class="active"
                 icon icon-id="flowTable" icon-size="42"
                 tooltip tt-msg="flowTip"
                 ng-click="nav('flow')"></div>

            <div class="current-view"
                 icon icon-id="portTable" icon-size="42"></div>

            <div class="active"
                 icon icon-id="groupTable" icon-size="42"
                 tooltip tt-msg="groupTip"
                 ng-click="nav('group')"></div>

            <div class="active"
                 icon icon-id="meterTable" icon-size="42"
                 tooltip tt-msg="meterTip"
                 ng-click="nav('meter')"></div>

            <div class="active"
                 icon icon-id="pipeconfTable" icon-size="42"
                 tooltip tt-msg="pipeconfTip"
                 ng-click="nav('pipeconf')"></div>
        </div>

        <div class="search">
            <input type="text" ng-model="query" placeholder="Search"/>
            <select ng-model="queryBy">
                <option value="" disabled>Search By</option>
                <option value="$">All Fields</option>
                <option value="id">Port ID </option>
                <option value="pkt_rx">Pkts Received</option>
                <option value="pkt_tx">Pkts Sent</option>
                <option value="bytes_rx">Bytes Received</option>
                <option value="bytes_tx">Bytes Sent</option>
                <option value="pkt_rx_drp">Pkts RX Dropped</option>
                <option value="pkt_rx_drp">Pkts TX Dropped</option>
                <option value="duration">Duration (sec) </option>
            </select>
        </div>
    </div>

    <div class="summary-list" onos-table-resize>
        <div class="table-header" onos-sortable-header>
            <table>
                <tr>
                    <td colId="id" col-width="60px" sortable>Port ID </td>
                    <td class="right" colId="pkt_rx" sortable>Pkts Received </td>
                    <td class="right" colId="pkt_tx" sortable>Pkts Sent </td>
                    <td class="right" colId="bytes_rx" sortable>Bytes Received </td>
                    <td class="right" colId="bytes_tx" sortable>Bytes Sent </td>
                    <td class="right" colId="pkt_rx_drp" sortable>Pkts RX Dropped </td>
                    <td class="right" colId="pkt_tx_drp" sortable>Pkts TX Dropped </td>
                    <td class="right" colId="duration" sortable>Duration (sec) </td>
                </tr>
            </table>
        </div>

        <div class="table-body">
            <table onos-flash-changes id-prop="id">
                <tr ng-if="!tableData.length" class="no-data">
                    <td colspan="8">
                        {{annots.no_rows_msg}}
                    </td>
                </tr>

                <tr ng-repeat="port in tableData | filter: customFilter(queryFilter, query) track by $index"
                    ng-click="selectCallback($event, port)"
                    ng-class="{selected: port.id === selId}"
                    ng-repeat-complete row-id="{{port.id}}">
                    <td>{{port.id}}</td>
                    <td ng-class="(isDelta() ? 'delta' : 'right')">{{port.pkt_rx}}</td>
                    <td ng-class="(isDelta() ? 'delta' : 'right')">{{port.pkt_tx}}</td>
                    <td ng-class="(isDelta() ? 'delta' : 'right')">{{port.bytes_rx}}</td>
                    <td ng-class="(isDelta() ? 'delta' : 'right')">{{port.bytes_tx}}</td>
                    <td ng-class="(isDelta() ? 'delta' : 'right')">{{port.pkt_rx_drp}}</td>
                    <td ng-class="(isDelta() ? 'delta' : 'right')">{{port.pkt_tx_drp}}</td>
                    <td ng-class="(isDelta() ? 'delta' : 'right')">{{port.duration}}</td>
                </tr>
            </table>
        </div>

    </div>

    <port-details-panel></port-details-panel>

</div>
